Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for NonZero types #2263

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Add tests for NonZero types #2263

merged 4 commits into from
Sep 23, 2024

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented Sep 23, 2024

This adds tests for the NonZero{I, U}{8, 16, 32, 64, 128} types for their encoding to and from JSON and MessagePack.

We use property tests here, generating random numbers inside the NonZero container and verifying their serializations are equivalent and that deserialization succeeds.

Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

packages/std/src/serde.rs Outdated Show resolved Hide resolved
@aumetra aumetra merged commit 5b16205 into main Sep 23, 2024
36 of 37 checks passed
@aumetra aumetra deleted the aw/nonzero-tests branch September 23, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants